/*
* Copyright 2018 Shanxi Lu'an Taihang Laihui Net Tech co.,LTD.
*/
package com.laihuichuxing.flyweight;

import java.util.HashMap;

/**
 * Description:
 *
 * @author: Qinxuefeng
 * @since: 1.0
 * Create Date Time: 2019/1/2 14:52
 * Update Date Time:
 */

public class FlyWeightFactory {
    private HashMap<String,FlyWeight> map = new HashMap<>();

    public FlyWeight getFlyWeight(String key){
        if(!map.containsKey(key)){
            map.put(key, new ConcreteFlyWeight());
        }
        return map.get(key);
    }
}
